package com.fenghongzhang.day003;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;

public class Main5Activity extends AppCompatActivity implements View.OnClickListener {

    private ImageView imageView;
    private Button button;
    private Button button6;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main5);

        imageView = findViewById(R.id.img);

         button = findViewById(R.id.btn);
         button6 = findViewById(R.id.btn6);

         button6.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 Intent intent = new Intent(Main5Activity.this, Main3Activity.class);
                 startActivity(intent);
             }
         });

         button.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        //换图片
        imageView.setImageResource(R.mipmap.kawayi);
    }

    public void btn5(View view) {
        Intent intent = new Intent(this, Main3Activity.class);
        startActivity(intent);
    }


}
